﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace myEmulators
{
    public class ThumbManager
    {
        Hashtable newEmuThumbIDs = null;
        object emuLock = new object();
        Hashtable newRomThumbIDs = null;
        object romLock = new object();



        public ThumbManager() 
        {
            newEmuThumbIDs = new Hashtable();
            newRomThumbIDs = new Hashtable();
        }

        #region Singleton
        static ThumbManager instance = null;
        static object lockOb = new object();
        public static ThumbManager Instance
        {
            get
            {
                if (instance == null)
                {
                    lock (lockOb)
                    {
                        if (instance == null)
                            instance = new ThumbManager();
                    }
                }
                return instance;
            }
        }
        #endregion

        

        public int GetNewThumbID(ThumbOwner ownerType)
        {
            

            return DB.getNewThumbID(ownerType);
        }

    }

    public enum ThumbType
    {
        Front,
        Back,
        Title,
        Screenshot
    }

    public enum ThumbOwner
    {
        Emulator,
        Rom
    }
}
